cmake_minimum_required(VERSION 3.10)
project(travoddsgen)

set(CMAKE_CXX_STANDARD 11)

# 当前目录下的所有源文件
file(GLOB SOURCES "*.cpp")

# Executable  
add_executable(travoddsgen ${SOURCES}) 
target_include_directories(travoddsgen PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})

if (NOT INSTALL_DIR)
set(INSTALL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../install")
message("INSTALL_DIR is not set, using default value ${INSTALL_DIR}")
endif()

# install travoddsgen
install(TARGETS travoddsgen RUNTIME DESTINATION ${INSTALL_DIR}/bin)
# 安装cmake目录
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../cmake DESTINATION "${INSTALL_DIR}")
# install doc
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../doc DESTINATION ${INSTALL_DIR})